#include <stdio.h>

int main()
{
    int i;
        
    i = -1;
    printf("i = %d\n", !i);     // 0
    printf("i = %d\n", !!i);    // 1
    printf("i = %d\n", !!!i);   // 0

    i = 0;
    printf("i = %d\n", !i);     // 1

    i = 1;
    printf("i = %d\n", !i);     // 0

    if (-1) {
        printf("output -1.\n"); // output -1.
    }

    if (!-1) {
        printf("output !-1.\n");
    }

    return 0;
}

#if 0

0000000000001149 <main>:
    1149:	f3 0f 1e fa          	endbr64 
    114d:	55                   	push   %rbp
    114e:	48 89 e5             	mov    %rsp,%rbp
    1151:	48 83 ec 10          	sub    $0x10,%rsp
    1155:	c7 45 fc ff ff ff ff 	movl   $0xffffffff,-0x4(%rbp)   // -1
    115c:	83 7d fc 00          	cmpl   $0x0,-0x4(%rbp)          // zf=0
    1160:	0f 94 c0             	sete   %al                      // al=0
    1163:	0f b6 c0             	movzbl %al,%eax                 // eax=0
    1166:	89 c6                	mov    %eax,%esi
    1168:	48 8d 3d 95 0e 00 00 	lea    0xe95(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>  // 0
    116f:	b8 00 00 00 00       	mov    $0x0,%eax
    1174:	e8 d7 fe ff ff       	callq  1050 <printf@plt>
    1179:	83 7d fc 00          	cmpl   $0x0,-0x4(%rbp)          // zf=0
    117d:	0f 95 c0             	setne  %al                      // al=1
    1180:	0f b6 c0             	movzbl %al,%eax                 // eax=1
    1183:	89 c6                	mov    %eax,%esi
    1185:	48 8d 3d 78 0e 00 00 	lea    0xe78(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>  // 1
    118c:	b8 00 00 00 00       	mov    $0x0,%eax
    1191:	e8 ba fe ff ff       	callq  1050 <printf@plt>
    1196:	83 7d fc 00          	cmpl   $0x0,-0x4(%rbp)          // zf=0
    119a:	0f 94 c0             	sete   %al                      // al=0
    119d:	0f b6 c0             	movzbl %al,%eax                 // eax=0
    11a0:	89 c6                	mov    %eax,%esi
    11a2:	48 8d 3d 5b 0e 00 00 	lea    0xe5b(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>  // 0
    11a9:	b8 00 00 00 00       	mov    $0x0,%eax
    11ae:	e8 9d fe ff ff       	callq  1050 <printf@plt>
    11b3:	c7 45 fc 00 00 00 00 	movl   $0x0,-0x4(%rbp)
    11ba:	83 7d fc 00          	cmpl   $0x0,-0x4(%rbp)          // zf=1
    11be:	0f 94 c0             	sete   %al                      // al=1
    11c1:	0f b6 c0             	movzbl %al,%eax                 // eax=1
    11c4:	89 c6                	mov    %eax,%esi
    11c6:	48 8d 3d 37 0e 00 00 	lea    0xe37(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>  // 1
    11cd:	b8 00 00 00 00       	mov    $0x0,%eax
    11d2:	e8 79 fe ff ff       	callq  1050 <printf@plt>
    11d7:	c7 45 fc 01 00 00 00 	movl   $0x1,-0x4(%rbp)
    11de:	83 7d fc 00          	cmpl   $0x0,-0x4(%rbp)          // zf=0
    11e2:	0f 94 c0             	sete   %al                      // al=0
    11e5:	0f b6 c0             	movzbl %al,%eax                 // eax=0
    11e8:	89 c6                	mov    %eax,%esi
    11ea:	48 8d 3d 13 0e 00 00 	lea    0xe13(%rip),%rdi        # 2004 <_IO_stdin_used+0x4>  // 0
    11f1:	b8 00 00 00 00       	mov    $0x0,%eax
    11f6:	e8 55 fe ff ff       	callq  1050 <printf@plt>
    11fb:	b8 00 00 00 00       	mov    $0x0,%eax
    1200:	c9                   	leaveq 
    1201:	c3                   	retq   

#endif
